<!-- $Id: goods_info.htm 17126 2010-04-23 10:30:26Z liuhui $ -->
{include file="pageheader.htm"}
{insert_scripts files="../js/utils.js,selectzone.js,colorselector.js"}
<script type="text/javascript" src="../js/calendar.php?lang={$cfg_lang}"></script>

<link href="../js/calendar/calendar.css" rel="stylesheet" type="text/css" />

{if $warning}
<ul style="padding:0; margin: 0; list-style-type:none; color: #CC0000;">
  <li style="border: 1px solid #CC0000; background: #FFFFCC; padding: 10px; margin-bottom: 5px;" >{$warning}</li>
</ul>
{/if}

<!-- start goods form -->
<div class="tab-div">
    <!-- tab bar -->
    <div id="tabbar-div">
	
    </div>

    <!-- tab body -->
    <div id="tabbody-div">
      <form enctype="multipart/form-data" action="" method="post" name="theForm" >
        <!-- 上传文件最大值的设置 -->
        <input type="hidden" name="MAX_FILE_SIZE" value="2097152" />
        <!--  稿件基本信息 -->
        <table width="90%" id="general-table" align="center">
          <tr>
            <td class="label">{$lang.lab_goods_name}</td>
            <td><input type="text" name="img_name" value="{$goods_img.img_name|escape}" style="float:left;color:{$goods_name_color};" size="30" /> {$lang.require_field}</td>
          </tr>
          <tr>
            <td class="label">{$lang.lab_goods_cat}</td>
            <td><select name="cat_id"><option value="0">{$lang.select_please}</option>{$cat_list}</select>{$lang.require_field} </td>
          </tr>
          <tr>
            <td class="label">{$lang.lab_goods_cat2}</td>
            <td><select name="cat2_id"><option value="0">{$lang.select_please}</option>{$cat_list2}</select>{$lang.require_field} </td>
          </tr>
          <tr>
            <td class="label">{$lang.lab_intro}</td>
            <td><input type="checkbox" name="is_best" value="1" {if $goods_img.is_best}checked="checked"{/if} />{$lang.is_best} <input type="checkbox" name="is_new" value="1" {if $goods_img.is_new}checked="checked"{/if} />{$lang.is_new} <input type="checkbox" name="is_hot" value="1" {if $goods_img.is_hot}checked="checked"{/if} />{$lang.is_hot}</td>
          </tr>
          <tr>
            <td class="label">{$lang.lab_market_price}</td>
            <td><input type="text" name="img_price" value="{$goods_img.img_price}" size="20" /></td>
          </tr>
          <tr>
            <td class="label">{$lang.lab_img_desc}</td>
            <td><textarea type="text" name="img_desc" value="{$goods_img.img_desc}" rows="3" cols="30"/>{$goods_img.img_desc}</textarea>
          </tr>
          <tr>
            <td class="label">{$lang.lab_picture}</td>
            <td>
              {if $goods_img.thumb_url}
                <a href="goods.php?act=show_image&img_url={$goods_img.img_url}" target="_blank"><img src="../{if $goods_img.thumb_url}{$goods_img.thumb_url}{else}{$goods_img.img_url}{/if}" {if $thumb_width neq 0}width="{$thumb_width}"{/if} {if $thumb_height neq 0}height="{$thumb_height}"{/if} border="0" /></a><br/><br/>
              {/if}			  	
              <input type="file" name="goods_img" size="35" />
            </td>
          </tr>
        </table>

        <div class="button-div">
          <input type="hidden" name="img_id" value="{$goods_img.img_id}" />
          <input type="button" value="{$lang.button_submit}" class="button" onclick="validate('{$goods_img.img_id}')" />
          <input type="reset" value="{$lang.button_reset}" class="button" />
        </div>
        <input type="hidden" name="act" value="{$form_act}" />
      </form>
    </div>
</div>
<!-- end goods form -->

<script  language="JavaScript">
  function validate(goods_id)
  {
	  var img_name = document.forms['theForm'].elements['img_name'].value;
	  if(img_name == null || img_name == ''){
		 alert(goods_name_not_null);
		 return false;
	  }
      if (document.forms['theForm'].elements['cat_id'].value == 0)
      {
	  		alert(goods_cat_not_null);
			return false;
      }

      if (document.forms['theForm'].elements['cat2_id'].value == 0)
      {
	  		alert(goods_cat2_not_null);
			return false;
      }
	
	  document.forms['theForm'].submit();
}

</script>

{include file="pagefooter.htm"}
